package com.zqu.service.impl;

import com.zqu.mapper.PManagerment.AdditionalProductMapper;
import com.zqu.pojo.AdditionalProduct;
import com.zqu.service.AdditionalProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdditionalProductServiceImpl implements AdditionalProductService {

    @Autowired(required = false)
    private AdditionalProductMapper additionalProductMapper;

    @Override
    public AdditionalProduct selectAdditionalProductById(long id) {
        return additionalProductMapper.selectTById(id);
    }

    @Override
    public List<AdditionalProduct> selectList(AdditionalProduct additionalProduct) {
        return additionalProductMapper.selectList(additionalProduct);
    }

    @Override
    public boolean insertAdditionalProduct(AdditionalProduct additionalProduct) {
        return additionalProductMapper.insertT(additionalProduct)>0;
    }

    @Override
    public boolean updateAdditionalProduct(AdditionalProduct additionalProduct) {
        return additionalProductMapper.updateT(additionalProduct)>0;
    }

    @Override
    public boolean deleteAdditionalProduct(long id) {
        return additionalProductMapper.deleteT(id)>0;
    }

    @Override
    public boolean deleteAdditionalProductByIds(String[] ids) {
        return additionalProductMapper.deleteTByIds(ids)>0;
    }
}
